package com.xd.core.debt.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 债权管理对应表
 * </p>
 *
 * @author ZCH
 * @since 2025-02-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Debt对象", description="债权管理对应表")
@Accessors(chain = true)
public class Debt implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "债权id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "借款订单编号")
    private Integer incomingId;

    @ApiModelProperty(value = "放款金额")
    private BigDecimal outAmount;

    @ApiModelProperty(value = "订单状态  1:还款中 2:已结清 3:已逾期")
    private Integer status;

    @ApiModelProperty(value = "债转状态  1:未转让 2:转让中 3:已转让")
    private Integer debtConversionStatus;

    @ApiModelProperty(value = "最近还款日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date latestRepaymentDate;

    @ApiModelProperty(value = "剩余还款期数")
    private Integer remainingRepaymentPeriods;

    @ApiModelProperty(value = "应还本金")
    private BigDecimal shouldRepayPrincipal;

    @ApiModelProperty(value = "应还利息")
    private BigDecimal shouldRepayInterest;

    @ApiModelProperty(value = "剩余应还本金")
    private BigDecimal remainingShouldRepayPrincipal;

    @ApiModelProperty(value = "剩余应还利息")
    private BigDecimal remainingShouldRepayInterest;

    @ApiModelProperty(value = "违约金")
    private BigDecimal currentRepaymentPenalty;

    @ApiModelProperty(value = "是否代收(0--代收,1--不代收)")
    private String isWithhold;

    @ApiModelProperty(value = "现债权方")
    private String originalCreditor;

    @ApiModelProperty(value = "原债权方")
    private String oldOriginalCreditor;

    @ApiModelProperty(value = "放款日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date disbursementDate;

    @ApiModelProperty(value = "是否提前还款 0--否,1--是")
    private String isEarly;

    @ApiModelProperty(value = "提前还款类型(0--资方发起,1--平台发起)")
    private String earlyType;

    @ApiModelProperty(value = "提起还款日期")
    private Date earlyDate;

    @ApiModelProperty(value = "提前还款总额")
    private BigDecimal earlyAmount;

    @ApiModelProperty(value = "账户号")
    private String earlyAccount;

    @ApiModelProperty(value = "户名")
    private String earlyName;

    @ApiModelProperty(value = "开户行")
    private String earlyBank;

    @ApiModelProperty(value = "资方id")
    private Integer companyId;

    @ApiModelProperty(value = "逾期利息(单位元)")
    private BigDecimal overdueInterest;

    @ApiModelProperty(value = "罚息(单位元)")
    private BigDecimal defaultInterestTodo;

    @ApiModelProperty(value = "首次还款日")
    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date firstRepaymentDate;

    @ApiModelProperty(value = "是否发起线下还款(0--否,1--是)")
    private String isOfflineRepay;

    @ApiModelProperty(value = "债权是否释放(0--否,1--是)")
    private String isReleased;

    @ApiModelProperty(value = "代扣次数")
    private Integer withholdingTimes;

    @ApiModelProperty(value = "实际提前还款日期")
    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date factEarlyDate;

    @ApiModelProperty(value = "公证执行书申请状态 0:未办理 1:办理申请中 2:办理完成")
    private String certificationApplyStatus;

    @ApiModelProperty(value = "购债金额（单条债权）")
    private BigDecimal purchaseAmountOfBonds;

    @ApiModelProperty(value = "提前释放债权原因")
    private String releasedReason;

    @ApiModelProperty(value = "债权自动释放时间")
    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date debtReleaseTime;

    @ApiModelProperty(value = "提前释放债权时间")
    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date earlyReleasedDate;

    @ApiModelProperty(value = "债权转让时间")
    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date debtTransDate;

    @ApiModelProperty(value = "公证执行书申请时间")
    private Date certificationApplyDate;

    @ApiModelProperty(value = "实际还款金额")
    private String repayAmount;

    @ApiModelProperty(value = "还款凭证")
    private String repayVoucher;

    @ApiModelProperty(value = "逾期天数")
    private Integer overdueDays;

    @ApiModelProperty(value = "放款ID")
    private Integer outId;
}
